﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleTesrt.LINQTest
{
    public static class Method1
    {
        public static IEnumerable<T> JiSuan<T>(this IEnumerable<T> Tsourse, Func<T, bool> Predicate)
        {
            foreach (T s in Tsourse)
            {
                if (Predicate(s))
                    yield return s;
            }
        }
        public static bool IndexStr(string name, string Predicate)
        {
            return name.IndexOf(Predicate) > -1;
        }
        public static void ForEach<T>(this IEnumerable<T> TSOURSE, Action<T> FUNC)
        {
            foreach (var item in TSOURSE)
            {
                FUNC(item);
            }
        }
    }

}
